from django.db import models

# Create your models here.
# 用户表
class User(models.Model):

    username = models.CharField(max_length=100,unique=True,null=False)

    password = models.CharField(max_length=100,null=False)
    # 权限
    promiss = models.CharField(max_length=100,null=False)

# 学院表
# class College(models.Model):
#     name = models.CharField("学院名称", max_length=100, unique=True)
#
#
# # 专业表（隶属于学院）
# class Major(models.Model):
#     name = models.CharField("专业名称", max_length=100)
#     college = models.ForeignKey(College, on_delete=models.CASCADE)
#
#
# # 班级表
# class Class(models.Model):
#     class_id = models.CharField("班级号", max_length=20, primary_key=True)
#     major = models.ForeignKey(Major, on_delete=models.CASCADE)
#     grade = models.CharField("年级", max_length=20)  # 如"大一"
#     student_count = models.IntegerField("人数")
#     counselor = models.ForeignKey("Teacher", on_delete=models.SET_NULL, null=True)  # 辅导员关联教师
#
#
# # 学生表
# class Student(models.Model):
#     GENDER_CHOICES = [("M", "男"), ("F", "女")]
#
#     student_id = models.CharField("学号", max_length=20, primary_key=True)
#     name = models.CharField("姓名", max_length=50)
#     gender = models.CharField("性别", max_length=1, choices=GENDER_CHOICES)
#     id_card = models.CharField("身份证号", max_length=18, unique=True)
#     photo = models.ImageField("照片", upload_to="students/")
#     _class = models.ForeignKey(Class, on_delete=models.CASCADE, verbose_name="所属班级")
#
#
# # 教师表
# class Teacher(models.Model):
#     teacher_id = models.CharField("工号", max_length=20, primary_key=True)
#     name = models.CharField("姓名", max_length=50)
#     gender = models.CharField("性别", max_length=1, choices=Student.GENDER_CHOICES)
#     id_card = models.CharField("身份证号", max_length=18, unique=True)
#     college = models.ForeignKey(College, on_delete=models.CASCADE)
#     position = models.CharField("职位", max_length=50)
#     photo = models.ImageField("照片", upload_to="teachers/")
#
#
# # 课程表
# class Course(models.Model):
#     course_id = models.CharField("课程号", max_length=20, primary_key=True)
#     name = models.CharField("课程名", max_length=100)
#     college = models.ForeignKey(College, on_delete=models.CASCADE)
#     credit = models.IntegerField("学分")
#     teacher = models.ForeignKey(Teacher, on_delete=models.CASCADE)
#     textbook = models.ForeignKey("Textbook", on_delete=models.SET_NULL, null=True)
#
#
# # 教材表
# class Textbook(models.Model):
#     isbn = models.CharField("ISBN", max_length=20, primary_key=True)
#     name = models.CharField("教材名", max_length=100)
#     description = models.TextField("简介", blank=True)
#
#
# # 教材领取申请
# class TextbookRequest(models.Model):
#     course = models.ForeignKey(Course, on_delete=models.CASCADE)
#     teacher = models.ForeignKey(Teacher, on_delete=models.CASCADE)
#     textbook = models.ForeignKey(Textbook, on_delete=models.CASCADE)
#     quantity = models.IntegerField("教材数量")
#     receive_time = models.DateTimeField("预约领取时间")
#     STATUS_CHOICES = [("pending", "待审核"), ("approved", "通过"), ("rejected", "拒绝")]
#     status = models.CharField("状态", max_length=10, choices=STATUS_CHOICES, default="pending")




